package com.xiaozhi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Author weirdor
 * @Description
 * @Date 2025/9/5 02:34
 */
@Getter
@AllArgsConstructor
public enum TransportEnum {

    WEBSOCKET(1,"websocket"),
    MQTT(2,"mqtt"),
    UDP(3,"udp");

    private Integer value;

    private String desc;

    public static TransportEnum toType(int value) {
        return Stream.of(TransportEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }

}
